package WrittenTest;

import java.util.Scanner;

public class test21 {
    // 给数字添加逗号
    // 算法原理: 模拟
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long number = in.nextLong();
        int count = 0;
        // 将数字转化为字符串
        StringBuffer ret = new StringBuffer();
        while (number != 0) {
            long tmp = number % 10;
            count++;
            ret.append(tmp);
            // 添加逗号,注意最后一位
            if (count % 3 == 0 && number / 10 != 0) {
                ret.append(",");
            }
            number /= 10;
        }
        // 注意要反转结果
        System.out.println(ret.reverse());
    }
}
